<?php
require_once("../data/common.php");

if (!empty($_POST["openid"])) {
	require_once YOULOC_DATA."/external/Auth/OpenID.php";

} else if (isset($_POST["username"]) && isset($_POST["password"]) ) {
	if (!empty($_POST["username"]) && !empty($_POST["password"]) ) {
		$username = $_POST["username"];
		$password = $_POST["password"];

		$user_data = $user->login($username, $password);
		if ( $user_data != null) {
			Header("Location: $site_url");
			exit;
		} else {
			print "Please enter correct user/pass combination.";
			exit;
		}
	} else {
		print "Please enter your username and password to login form!";
		exit;
	}
	exit;
}


$template = new STE();
$template->load("login");
$template->assign($variables);
print $template->display();

?>
